package org.example;

import org.openjdk.jol.info.ClassLayout;

public class Main12 {


    public static void main(String[] args) {
        Object o = new Object();
        System.out.println(ClassLayout.parseInstance(o).toPrintable()); //偏向锁
        System.out.println(Integer.toHexString(o.hashCode()));
        System.out.println(ClassLayout.parseInstance(o).toPrintable());//无锁
        synchronized (o){
            System.out.println(ClassLayout.parseInstance(o).toPrintable());//轻量级锁
        }
    }
}
